package com.example.demo.controller;

import com.example.demo.dto.MbtiSubmitDTO;
import com.example.demo.service.MbtiResultService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/mbti")
@CrossOrigin
public class MbtiResultController {

    @Autowired
    private MbtiResultService mbtiResultService;

    @Operation(summary = "提交 MBTI 测试结果")
    @PostMapping("/submit")
    public String submitResult(@RequestBody MbtiSubmitDTO dto) {
        mbtiResultService.submitResult(dto);
        return "提交成功";
    }
}
